#pragma once

#include <QObject>
#include <QTcpSocket>

class Player : public QObject {
    Q_OBJECT
private:
    QTcpSocket* socket;
    QString name;

public:
    explicit Player(QTcpSocket* socket);

    void sendMessage(const QString& msg);

    const QString& getName() const;

public slots:
    void onReadyRead();

    void onDisconnected();

signals:
#pragma clang diagnostic push
#pragma ide diagnostic ignored "NotImplementedFunctions"
    void named(QString name);
    void disconnected();
#pragma clang diagnostic pop
};
